// 导入request模块
import request from '../utils/request.js'

// 定义获取文章所有评论的接口 注意这个接口也可以获得所有评论的评论(评论的回复)
export const getArticleComments = (params) => {
  return request({
    method: 'GET',
    url: '/app/v1_0/comments',
    params
  })
}

// 定义点赞文章评论的接口
export const addArticleLiked = (target) => {
  return request({
    method: 'POST',
    url: '/app/v1_0/comment/likings',
    data: {
      target
    }
  })
}
// 定义取消点赞文章评论的接口
export const cannelArticleLiked = (target) => {
  return request({
    method: 'DELETE',
    url: `/app/v1_0/comment/likings/${target}`
  })
}

// 定义发布文章评论的接口
export const addArticleComment = (data) => {
  return request({
    method: 'POST',
    url: '/app/v1_0/comments',
    data
  })
}
